package edu.hut.bookshop.dao;

import edu.hut.bookshop.pojo.Book;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


public interface BookMapper extends CrudRepository<Book,String>{
    int deleteByBookId(Integer bookId);

    int insert(Book record);

    Book selectByBookId(Integer bookId);

    int updateByBookId(Book record);

    List<Book> selectAllByCategoryCode(String categoryCode);

    List<Book> selectByBooks(Book book);

    /**
     * 通过商家名查找商品
     * @param bName
     * @return
     */
    List<Book> selectBybName(String bName);
}